﻿using COC.Algorithm;
using UnityEngine;
using System.Collections;

public class OnePlayer : MonoBehaviour
{

    // Use this for initialization
    void Awake()
    {

        StartCoroutine(createRequirements());
       
        this.gameObject.SetActive(false);

    }

    // Update is called once per frame
    void Update()
    {

    }

    IEnumerator createRequirements()
    {
        GameObject go = new GameObject();
        go.name = "ObjectsPool";
        go.tag = "Pool_Manager";
        go.AddComponent<ObjectPool>();
        DontDestroyOnLoad(go);
        GameObject go2 = new GameObject();
        go2.name = "objectTest2";
        go2.AddComponent<ObjectPoolTest>();
        Instantiate(go2);
       /* GameObject go3 = new GameObject();
        go3.name = "objectTest3";
        go3.AddComponent<ObjectPoolTest>();
        Instantiate(go3);*/
        Debug.Log("It's ok");
        yield return null;
    }
}
